package com.yonyou.cyxdms.sysAuth.service.controller.area;

import com.yonyou.cyxdms.sysAuth.service.dto.area.AreaDTO;
import com.yonyou.cyxdms.sysAuth.service.service.areaService.DealerAttchAreaservice;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/area")
@Api(value = "获取组织", tags = {"获取组织"})
public class DealerAttchArea {
    @Autowired
    private DealerAttchAreaservice dealerAttchAreaservice;
    /**
     * 根据组织类型获取组织
     *
     * @param:
     * @return:
     * @auther: MAXINGJIAN
     * @since: 2019/9/25
     */
    @GetMapping("/getOrgByOrgType4cms")
    @ApiOperation("根据组织类型获取组织")
    @ApiImplicitParams({@ApiImplicitParam(value = "用户id", name = "userId", required = true, dataType = "string",
            paramType = "header")})
    public List<AreaDTO> getLevelOneArea1(@ApiParam(name = "orgType", value = "组织类型", required = true)
                                                            @RequestParam(required = true) List<String> orgType) {
        System.out.println(orgType);
       return dealerAttchAreaservice.getOrgByOrgType4cms(orgType);


    }
}
